#include <iostream>
#include <string.h>
using namespace std;

int main(int argc, char const *argv[])
{
  printf("欢迎登录 XX管理系统! 请输入您的登录密码(123456)\n");
  printf("password:\n");

  int count = 3;
  char pass[100];

  // 验证密码
  while (count > 0)
  {
    scanf("%s", &pass);

    if (strcmp(pass, "123456") == 0)
    {
      break;
    }
    else
    {
      count--;
      printf("Password is wrong. You have %d time to retry.\n", count);
    }
  }

  // 判断是否登录成功
  if (count > 0)
  {
    printf("You are welcome!");
  }
  else
  {
    printf("I am sorry \n");
  }

  return 0;
}
